﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="KPIS.GERP.ESS.APP.App_UI.Forms.Login" %>
<%@ Import Namespace="KPIS.GERP.ESS.BLL" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ยินดีต้อนรับสู่ระบบ G-ERP</title>
    <%--<meta http-equiv="X-UA-Compatible" content="IE=8" />--%>
    <link href= "../Styles/CssClass.css" rel="cssclass" type="text/css" />
    <link href= "../Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body style="text-align: center; ">
    <form id="form1" runat="server" style="font-family:sans-serif; font-size: medium">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <%--<telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="PanelLogin">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PanelLogin" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>--%>
        
        <telerik:RadCodeBlock ID="RadCodeBlockMaster" runat="server">
            <script type="text/javascript">            
                function GetHeight() 
                {
                    var myHeight = 0;
                    if( typeof( window.innerWidth ) == 'number' )
                    {
                        //Non-IE
                        myHeight = window.innerHeight;
                    }
                    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
                    {
                        //IE 6+ in 'standards compliant mode'
                        myHeight = document.documentElement.clientHeight;
                    }
                    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
                    {
                        //IE 4 compatible
                        myHeight = document.body.clientHeight;
                    } 
                    document.getElementById('<%=hHeight.ClientID %>').value = myHeight;
                }
            </script>
        </telerik:RadCodeBlock>
        <asp:HiddenField id="hHeight" runat="server" />
        <table cellpadding="0" cellspacing="0" align="center">
            <tr>
                <td>
                    <asp:Panel ID="PanelHeader" runat="server" Width="1000px" Height="100px" />
                    <div class="HeaderColor">
                        ยินดีต้อนรับสู่ระบบ G-ERP
                    </div>
                    <table>
                        <tr>
                            <td height="20px">
                            </td>
                        </tr>
                        <tr>
                            <td align="center" >
                                <table width="450px" style="text-align: left">
                                    <tr>
                                        <td>
                                            <table>
                                                <tr>
                                                    <td align="right" style="font-weight: bold; color: #647B8F;" width="150px">
                                                        รหัสประจำตัว :</td>
                                                    <td align="left">
                                                        <telerik:RadTextBox ID="txtUserID" Runat="server" autocomplete="off" >
                                                        </telerik:RadTextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right" style="font-weight: bold; color: #647B8F;" >
                                                        รหัสผ่าน :</td>
                                                    <td align="left">
                                                        <telerik:RadTextBox ID="txtPassword" Runat="server" TextMode="Password" autocomplete="off" >
                                                        </telerik:RadTextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="20px" align="center">
                                            <asp:Label ID="lblError" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center">
                                            <asp:Button ID="cmdLogin" runat="server" OnClientClick="GetHeight()" 
                                                Text="เข้าสู่ระบบ" Width="100" onclick="cmdLogin_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="20px">
                                        </td>
                                    </tr>
                                </table>
                                <table style="border-top-style: solid; border-width: 1px; border-color: #808080" width="980px">
                                    <tr>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="color: #0000FF; font-size: medium; text-align:center">
                                            แสดงผลได้ถูกต้องบน Internet Explorer 8 ขึ้นไป
                                        </td>
                                    </tr>
                                    <%--<tr>
                                        <td style="color: #FF0000; font-size: medium; text-align:center">
                                            หากพบปัญหาการใช้งาน กรุณาโทรแจ้ง 7829,7860,7855 หรือ Email มาที่ gerp@ditp.go.th พร้อมทั้งแจ้งชื่อและหน่วยงานด้วย 
                                        </td>
                                    </tr>--%>
                                    
                                    <!-- Permanent disable feature (Easy login on developing)-->
                                    <%--
                                    <%
                                        RadGrid1.DataSource = new ComboESSBLL().Detail();
                                        RadGrid1.DataBind();
                                        
                                        protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
                                        {
                                            string userCitizen = RadGrid1.SelectedItems.Count > 0 && (RadGrid1.SelectedItems[0] as GridDataItem) != null
                                                                     ? (RadGrid1.SelectedItems[0] as GridDataItem)["UserName"].Text
                                                                     : String.Empty;
                                            string userPassword = RadGrid1.SelectedItems.Count > 0 && (RadGrid1.SelectedItems[0] as GridDataItem) != null
                                                                      ? (RadGrid1.SelectedItems[0] as GridDataItem)["PassWord"].Text
                                                                      : String.Empty;

                                            if (!String.IsNullOrEmpty(userCitizen))
                                            {
                                                ProcessLogin(userCitizen, userPassword);
                                            }
                                        }
                                     %>
                                     <tr>
                                        <td style="color: #FF0000; font-size: medium; text-align:center">
                                            <br/>
                                            <asp:Label runat="server" ID="NoticeShowUserListLoginPage" 
                                                Text="<b>Remark</b>: Hide by change in  [web.config] section [AppSetting] set [ShowUserListLoginPage = false]" 
                                                Visible='<%#ShowUserListLoginPage%>'></asp:Label>
                                            <telerik:RadGrid ID="RadGrid1" runat="server" Width="100%" Visible='<%#ShowUserListLoginPage%>'
                                                onselectedindexchanged="RadGrid1_SelectedIndexChanged" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Skin="Metro" >
                                                <ClientSettings EnablePostBackOnRowClick="True">
                                                    <Selecting AllowRowSelect="True" />
                                                    <ClientEvents  OnRowClick="GetHeight"  /> 
                                                </ClientSettings>
                                                <MasterTableView>
                                                    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                                                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                                        <HeaderStyle Width="20px"></HeaderStyle>
                                                    </RowIndicatorColumn>

                                                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                                        <HeaderStyle Width="20px"></HeaderStyle>
                                                    </ExpandCollapseColumn>

                                                    <Columns> 
                                                        <telerik:GridBoundColumn DataField="UserName" FilterControlAltText="Filter column column" HeaderText="UserName" UniqueName="UserName" >
                                                            <HeaderStyle Width="80px" HorizontalAlign="Center"/>
                                                            <ItemStyle HorizontalAlign="Left"/>
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="PassWord" FilterControlAltText="Filter PassWord column" HeaderText="PassWord" UniqueName="PassWord" Visible="False">
                                                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                                                            <ItemStyle BackColor="Black" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="FullName" FilterControlAltText="Filter column1 column" HeaderText="FullName" UniqueName="FullName">
                                                            <HeaderStyle Width="150px" HorizontalAlign="Center"/>
                                                            <ItemStyle HorizontalAlign="Left"/>
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="Approvable" FilterControlAltText="Filter column2 column" HeaderText="Approvable" UniqueName="Approvable">
                                                            <HeaderStyle Width="30px" HorizontalAlign="Center"/> 
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="Position" FilterControlAltText="Filter column3 column" HeaderText="Position" UniqueName="Position">
                                                            <HeaderStyle Width="180px" HorizontalAlign="Center"/>
                                                            <ItemStyle HorizontalAlign="Left"/>
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="JobSite" FilterControlAltText="Filter column4 column" HeaderText="JobSite" UniqueName="JobSite">
                                                            <HeaderStyle Width="180px" HorizontalAlign="Center"/>
                                                            <ItemStyle HorizontalAlign="Left"/>
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="System" FilterControlAltText="Filter column5 column" HeaderText="System" UniqueName="System" Visible="False">
                                                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="emp_seq" FilterControlAltText="Filter column6 column" HeaderText="emp_seq" UniqueName="emp_seq" Visible="False">
                                                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                                                            <ItemStyle BackColor="Black" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="user_seq" FilterControlAltText="Filter column7 column" HeaderText="user_seq" UniqueName="user_seq" Visible="False">
                                                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                                                            <ItemStyle BackColor="Black" HorizontalAlign="Left"/>
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                    <EditFormSettings>
                                                        <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                                                    </EditFormSettings>

                                                </MasterTableView>

                                                <FilterMenu EnableImageSprites="False"></FilterMenu>
                                            </telerik:RadGrid>
                                        </td>
                                    </tr>
                                     --%>

                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
